﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Demo05
{
    class SumUtils
    {
        public int a { get; set; }
        public int b { get; set; }
        public double c { get; set; }
        public double d { get; set; }
        public string e { get; set; }
        public string f { get; set; }

        public void SumAdd(int a, int b)
        {
            int sum;
            sum = a + b;
            Console.WriteLine("整数和为：" + sum);
        }
        public void SumAdd(double c, double d)
        {
            double sum;
            sum = c + d;
            Console.WriteLine("小数和为：" + sum);
        }
        public void SumAdd(string e, string f)
        {
            string sum;
            sum = e + f;
            Console.WriteLine("字符号和为：" + sum);
        }
        public void SumAdd(int g)
        {
            int sum = 0;
            for (int i = 0; i < g; i++)
            {
                sum += g;
            }
            Console.WriteLine("从1到指定整数的和为：" + sum);
        }
        }
}
